/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.gov.igac.observatorio.beans.navegacion;

import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
import java.io.Serializable;
import javax.faces.context.FacesContext;

/**
 *
 * @author jgamba
 */
@Named(value = "navegacionBean")@SessionScoped
public class NavegacionBean implements Serializable {

    /** Creates a new instance of NavegacionBean */
    public NavegacionBean() {
    }
    private String includedPage = "./plantilla/inicio.xhtml";

    public String navegar() {
        
        FacesContext context = FacesContext.getCurrentInstance();
        String selectedPageViewId =
                context.getExternalContext().getRequestParameterMap().get("paginaSolicitada");

        if (selectedPageViewId.equalsIgnoreCase("FI")) {
            includedPage = "/ideaInvestigacion/idea/Create.xhtml";
        } else if (selectedPageViewId.equalsIgnoreCase("ejemplo2")) {
            includedPage = "/plantilla/inicio_2.xhtml";
        } 
        return "";
    }

    /**
     * @return the includedPage
     */
    public String getIncludedPage() {
        return includedPage;
    }

    /**
     * @param includedPage the includedPage to set
     */
    public void setIncludedPage(String includedPage) {
        this.includedPage = includedPage;
    }
}
